import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  { path: '/login', name: 'login', component: () => import('../views/Login.vue') },
  { 
    path: '/student', 
    component: () => import('../views/student/StudentLayout.vue'),
    children: [
      { path: '', redirect: 'dashboard' },
      { path: 'dashboard', name: 'student-dashboard', component: () => import('../views/student/Dashboard.vue') },
      { path: 'apply-scholarship', name: 'apply-scholarship', component: () => import('../views/student/ApplyScholarship.vue') },
      { path: 'my-applications', name: 'my-applications', component: () => import('../views/student/MyApplications.vue') },
      { path: 'course-scores', name: 'course-scores', component: () => import('../views/student/CourseScores.vue') },
      { path: 'scholarship-rules', name: 'scholarship-rules', component: () => import('../views/ScholarshipRules.vue') },
    ]
  },
  { path: '/professor/dashboard', name: 'professor-dashboard', component: () => import('../views/professor/Dashboard.vue') },
  { path: '/professor/review-applications', name: 'review-applications', component: () => import('../views/professor/ReviewApplications.vue') },
  { path: '/professor/scoreboard', name: 'scoreboard', component: () => import('../views/professor/Scoreboard.vue') },
  { path: '/professor/course-score-management', name: 'course-score-management', component: () => import('../views/professor/CourseScoreManagement.vue') },
  { path: '/', redirect: '/login' }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router